$.fn.roll=function(options){
	$("html,body").css("height","100%");
	/*图片数组：图片路径，链接路径*/
	var imgs = options.imgs;
	/*图片宽度*/
	var imgWidth = options.width;
	/*图片高度*/
	var imgHeight = options.height;
	/*单位*/
	var units = options.units;
	/*间隔时间*/
	var time = options.time;
	/*轮播方向：X、Y*/
	var direction = options.direction;
	this.css({"height":imgHeight+units,"width":imgWidth+units,"margin":"0 auto","overflow":"hidden"});
	
	var liWidth = (this.width())*imgs.length;
	this.append("<ul class='imgul' style='width:"+liWidth+"px;height:100%;transition:1s;'></ul>");
	for(var i=0;i<imgs.length;i++){
		var href = imgs[i].href;
		if(href==null || href==""){
			href="javascript:void(0)";
		}
		this.find("ul").append("<li style='width:"+this.width()+"px;height:100%;'><a href='"+href+"'><img src='"+imgs[i].src+"' width='100%' height='100%' /></a></li>");
	}
	this.find("*").css({"list-style":"none","margin":0,"padding":0,"transition":"1s"});
	var positionX = this.width();
	var positionY = this.height();
	var count = 0;
	if(direction==undefined || direction.toLocaleUpperCase()=="X"){
		this.find("li").css({"float":"left"});
		var $ul = this.find("ul");
		setInterval(function(){
			count+=1;
			if(count==imgs.length){
				count=0;
			}
			var marginLeft = -positionX*count;
			$ul.css({"margin-left":marginLeft+"px"});
		},time);
	}else if(direction.toLocaleUpperCase()=="Y"){
		var $ul = this.find("ul");
		var marginTop = 0;
		var maxTop = -positionY*(imgs.length-1);
		setInterval(function(){
			count+=1;
			if(count==imgs.length){
				count=0;
			}
			var marginTop = -positionY*count;
			$ul.css({"margin-top":marginTop+"px"});
		},time);
	}
}
